<?
function checkLogin($username, $password){
	$username	= replaceMQ($username);
	$password	= replaceMQ($password);
	$adm_id		= 0;
   
	$db_check	= new db_query("SELECT adt_id 
										 FROM administrator
										 WHERE adt_username = '" . $username . "' AND adt_password = '" . md5($password) . "' AND adt_status = 1");
	
   if(mysql_num_rows($db_check->result) > 0){
		$check	= mysql_fetch_array($db_check->result);
		$adt_id	= $check["adt_id"];
		$db_check->close();
		unset($db_check);
		return $adt_id;
	}
	else{
		$db_check->close();
		unset($db_check);
		return 0;
	}
}
function checklogged($denypath = ""){ 
    if($denypath == ""){
        $denypath="../../login.php"; 
        $password = getValue("password", "str", "SESSION", ""); 
        $username = getValue("userlogin", "str", "SESSION", ""); 
        $user_id = getValue("user_id", "str", "SESSION", ""); 
        $checsum = getValue("checsum", "str", "SESSION", "");
    }
}
?>